<template>
 <view class="page">
	  <view class="newsList">
	       <view class="item" v-for="item in newsList">
	         <view class="author-img-box">
	           <image class="author-img" :src="item.messageListVo.shareList[0].preUser.iconUrl"/>
	         </view>
	         <view class="text">
	           <view class="top">
	             <view class="name">
	               {{item.messageListVo.name}}
	             </view>
	             <view class="time">
	               {{item.messageListVo.time}}
	             </view>
	           </view>
	           <view class="content">
	             {{item.messageListVo.content}}
	           </view>
	         </view>
	       </view>
		   
	  </view>
	  <view class="content2">
	  		  <label class="label">-- 暂无信息 --</label>
	  </view>
 </view>
</template>

 




<script>
	
	import utils from '@/utils/requset.js'
	import operate from '@/common/operate.js'
	import app from '@/App.vue'
	export default {
		data() {
			return {
				newsList:[
				] 
			}
		},
		onShow() {
			app.navTitle();
			let userId = uni.getStorageSync("userInfo").id;
			this.getNotice(userId);
		},
		methods: {
				getNotice(userId){
					// 请求参数
					var header = {},
						data = {
							pubUserIdTarget:userId
						},
						url = "/purchase/shopOrOrderMyLike/listOfMsg", 
						method = "POST";
					if (method) {
						method = method.toUpperCase(); 
						if (method == "POST") {
							header = {
							   'Content-Type': "application/json"
							};
						} else {
							header = {
								'Content-Type': "application/json"
							};
						}	
					}
								 
					 uni.request({
						url: operate.api + url,		
						data: data,
						method: method,
						header: header,
						success: (res) => {
							console.log(res)
							if(res.statusCode && res.statusCode ==200){
								 
								if(res.data.data){
									 this.newsList = res.data.data;
								} 
							}else{
								console.log("数据状态码！=200")
							}
							
						},fail(res2) {
							 
						},complete() {
							 
						}
					})
				},
				
				

		}
	}
</script>
<style>
 .page{
 	width: 100%;
 	background-color: #fff;
 	font-size: 13px;
 	font-weight: 400;
 	letter-spacing: 0px;
 	line-height: 20px;
 }
  
  .label{
	  text-align: center;
	  width: 100%;
  }
  .newsList{
    background: #fff;
	margin-left: 10px;
	margin-right: 10px;
	margin-bottom: 70px;
  }
  .item{
    height: 60px;
    padding: 10px 0px;
	border-bottom: 1px solid #eee;
  }
  .author-img-box{
    float: left;
    margin-left: 10px;
  }
  .author-img{
    width: 45px;
    height: 45px;
    border-radius: 50%;
  }
  .text{
    float: left;
    margin-left: 10px;
    height: 50px;
    width: 75%;
    color: black;
  }
  .top{
    height: 25px;
    line-height: 25px;
  }
  .name{
    float: left;
    font-size: 13px;
  }
  .time{
    float: right;
    font-size: 10px;
    color: #aaaaaa;
  }
  .content{
    height: 25px;
    line-height: 25px;
    font-size: 12px;
    color: #aaaaaa;
	 
  }
  .content2{
	margin-top: 5px;
    height: 25px;
    line-height: 25px;
    font-size: 10px;
    color: #aaaaaa;
  	text-align: center;
  }
  .more{
    width: 100%;
    height: 50px;
    line-height: 50px;
    color: #aaaaaa;
    text-align: center;
    font-size: 12px;
  }
</style>